Repository navigation
feat(bruno): add a yml format for OpenCollection collections - #21
Merged
Merged
Conversation
A Bruno collection with an opencollection.yml does not load .bru files, so the generated requests did not show up in it. format: "yml" writes them as OpenCollection requests instead; the default stays bru. clean now removes generated requests of both formats, so switching leaves none behind.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Bruno collection in the OpenCollection format (an
opencollection.ymlin its root, requests as.yml) does not load.brufiles. The plugin only wrote.bru, so in such a collection the generated requests were on disk but never showed up in Bruno.What
format: "bru" | "yml", defaultbru— existing users get the same output.ymlwrites each operation as an OpenCollection GraphQL request:info(name, type,seqper folder),graphql(method, url, headers,body.query,body.variables) andauth(noneis omitted,inheritas-is, any other mode as{ type }). Strings are written as JSON (valid YAML double-quoted scalars) and the query/variables as block scalars, so no YAML dependency is added to the plugin.cleannow removes previously generated requests of both formats (.bruand.yml, exceptfolder.bru/folder.yml), so switching format leaves no stale requests behind.Testing
cleanremoving a stale.ymlunder the default format. The new tests fail without theindex.tschange.format: "yml": every file parses as YAML, its query parses as GraphQL and its variables as JSON; the old.brufiles were cleaned up.